package com.tqw.shipping.mapper;

import com.tqw.shipping.pojo.Receiving;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author: czm
 * @Date: 2022/04/12/19:35
 * @Description:
 */
public interface ShippingMapper{

    /**
     * 获取用户地址列表
     * @param clientId
     * @return
     */
    List<Receiving> list(@Param("clientId") Integer clientId);

    /**
     * 移除用户默认地址
     * @param clientId
     */
    void removeDefaultAddr(@Param("clientId") Integer clientId);

    /**
     * 保存用户地址
     * @param receiving
     */
    void save(@Param("receiving") Receiving receiving);

    /**
     * 更新用户地址
     * @param receiving
     */
    void update(@Param("receiving") Receiving receiving);

    /**
     * 用户收货信息的数量
     * @param clientId
     * @return
     */
    int countByClientId(Integer clientId);

    Receiving getAddrByClientIdAndId(@Param("addressId") Integer addressId, @Param("clientId") int clientId);

    void deleteById(@Param("addrId") Integer addrId,@Param("clientId") Integer clientId);
}
